import Mock from 'mockjs'

Mock.mock('/api/products', 'get', {
  "status": 0,
  "data": {
    "pageNum": 1,
    "pageSize": 10,
    "size": 2,
    "orderBy": null,
    "startRow": 1,
    "endRow": 2,
    "total": 2,
    "pages": 1,
    "list|3-5": [
      {
        "id|+1": 1,
        "categoryId|+1": 3,
        "name": "iphone7",
        "subtitle": "双十一促销",
        "mainImage": "mainimage.jpg",
        "status": 1,
        "price": 7199.22
      }
    ],
    "firstPage": 1,
    "prePage": 0,
    "nextPage": 0,
    "lastPage": 1,
    "isFirstPage": true,
    "isLastPage": true,
    "hasPreviousPage": false,
    "hasNextPage": false,
    "navigatePages": 8,
    "navigatepageNums": [
      1
    ]
  }
})
Mock.mock('/api/products/10', 'get', {
  "status|1": [0, 1],
  "data": {
    "id": 2,
    "categoryId": 2,
    "name": "oppo R8",
    "subtitle": "oppo促销进行中",
    "mainImage": "mainimage.jpg",
    "subImages": "[\"mmall/aa.jpg\",\"mmall/bb.jpg\",\"mmall/cc.jpg\",\"mmall/dd.jpg\",\"mmall/ee.jpg\"]",
    "detail": "richtext",
    "price": 2999.11,
    "stock": 71,
    "status": 1,
    "createTime": new Date().getTime(),
    "updateTime": new Date().getTime(),
  }
})
